// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

@ccclass
export default class Loading extends cc.Component {

    @property(cc.ProgressBar)
    bar: cc.ProgressBar = null;


    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {
        cc.tween(this.bar)
            .to(2,{progress:1})
            .call(() => {
                cc.director.loadScene("lobby");
            })
            .start();
    }

    // update (dt) {}
}
